home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Celestin Apprentice 4
/
Apprentice-Release4.iso
/
Languages
/
Caml Light 0.7
/
Caml Light 0.7 source
/
src
/
Makefile
< prev
next >
Wrap
Makefile
|
1995-07-04
|
4KB
|
129 lines
MAKE = do make
MAKEQ = do -quiet make
SUBDIRS = runtime launch lib compiler linker librar toplevel lex yacc tools ∂
man appli
# Build the system for the first time
world ƒ
execute :config
set CPPC "{CTOOLPPC}"
Directory tools; {MAKE} clprepro; Directory ::
duplicate -y :tools:clprepro :
Directory runtime;
{MAKEQ} all -d arch=68k;
{MAKEQ} all -d arch=PPC;
Directory ::
:tools:fatmerge :runtime:camlrunPPC :runtime:camlrun68k :camlrun
flush
Directory yacc;
{MAKEQ} all -d arch=68k;
{MAKEQ} all -d arch=PPC;
Directory ::
:tools:fatmerge :yacc:camlyaccPPC :yacc:camlyacc68k :camlyacc
flush
Directory lib; {MAKE} all; Directory ::
Directory compiler; {MAKE} all; Directory ::
Directory linker; {MAKE} all; Directory ::
Directory librar; {MAKE} all; Directory ::
Directory lex; {MAKE} all; Directory ::
Directory toplevel; {MAKE} all; Directory ::
Directory launch; {MAKE} all; Directory ::
set CPPC "{CAPPLPPC}"
Directory appli;
{MAKEQ} all -d arch=68k;
{MAKEQ} all -d arch=PPC;
Directory ::
:tools:fatmerge ':appli:caml light PPC' ':appli:caml light 68k' ':Caml Light'
echo "Let us quickly test the toplevel tool."
(echo '1+2;;'; ∂
echo 'let rec fib n = if n<2 then 1 else fib(n-1)+fib(n-2);;'; ∂
echo 'fib 20;;') | :camlrun :toplevel:camltop -stdlib :lib:
echo "Is that 10946 on the line above? Good."
echo "The CAML Light system is up and running."
# Rebuild the system (bootstrap)
bootstrap ƒ backup promote again compare
# Save a copy of the current compiler
backup ƒ
:tools:clbackup camlrun camlcomp camllink camllibr camllex
# Make the newly compiled compiler the current compiler
promote ƒ
flush
Duplicate -y :compiler:camlcomp :linker:camllink :librar:camllibr ∂
:lex:camllex :
# Recompile bootstrapped Caml code from scratch
again ƒ
flush
execute config
Directory lib; {MAKE} clean; {MAKE} all; Directory ::
Directory compiler; {MAKE} clean; {MAKE} all; Directory ::
Directory linker; {MAKE} clean; {MAKE} all; Directory ::
Directory librar; {MAKE} clean; {MAKE} all; Directory ::
Directory lex; {MAKE} clean; {MAKE} all; Directory ::
# Compare the current compiler with the newly compiled one
compare ƒ
Set Exit 0
Equal -d camlcomp :compiler:camlcomp
Equal -d camllink :linker:camllink
Equal -d camllibr :librar:camllibr
Equal -d camllex :lex:camllex
Set Exit 1
# Restore the latest backup copy of the compiler
restore ƒ
flush
:tools:clrestore camlrun camlcomp camllink camllibr camllex
# Compile all Caml code
compile ƒ
execute config
Directory lib; {MAKE} all; Directory ::
Directory compiler; {MAKE} all; Directory ::
Directory linker; {MAKE} all; Directory ::
Directory librar; {MAKE} all; Directory ::
Directory lex; {MAKE} all; Directory ::
Directory toplevel; {MAKE} all; Directory ::
# Install the Caml Light system
install ƒ
execute config
NewFolder "{LIBDIR}" ||echo
newfolder "{BINDIR}" ||echo
duplicate -y camlmsgs.txt "{LIBDIR}"
for i in {SUBDIRS}
directory "{i}"; {MAKE} install; directory ::
end
# Remove the Caml Light system after installation
uninstall ƒ
execute config
delete -y -i "{LIBDIR}"
delete -i "{BINDIR}"camlrun "{BINDIR}"camlc "{BINDIR}"camllight ∂
"{BINDIR}"camlyacc "{BINDIR}"camllex "{BINDIR}"camlmktop ∂
"{BINDIR}:caml light"
# Remove all generated files (except the makefiles and the bootstrap compilers)
clean ƒ
execute config
for d in {SUBDIRS}
directory {d}; {MAKE} clean; directory ::
end
# Rebuild the dependencies in all Makefiles
depend ƒ
execute config
for d in {SUBDIRS}
directory {d}; {MAKE} depend; directory ::
end
# Rebuild all the generated source files.
gensrc ƒ
execute config
for d in {SUBDIRS}
directory {d}; {MAKE} gensrc; directory ::
end